/**
 * @file speech_recog.h
 *
 */
#ifndef SPEECH_RECOG_H
#define SPEECH_RECOG_H

#ifdef __cplusplus
extern "C" {
#endif

/*********************
*      INCLUDES
*********************/

#ifdef LV_CONF_INCLUDE_SIMPLE
#include "lvgl.h"
#include "lv_watch_conf.h"
#else
#include "../../../lvgl/lvgl.h"
#include "../../../lv_watch_conf.h"
#endif

#if USE_LV_WATCH_SPEECH_RECOG != 0

/*********************
*      DEFINES
*********************/

/**********************
*      TYPEDEFS
**********************/
typedef struct
{
    lv_watch_obj_ext_t old_ext;
    lv_style_t style_txt_from_other;
    lv_style_t style_txt_from_self;
    lv_style_t style_cont_msg;
    lv_obj_t * page;
    uint8_t * voice_data;
    lv_coord_t width_omit;
    bool pressing;
    uint8_t audio_num;
    uint8_t * buffer;
    lv_signal_cb_t ancient_page_scrl_signal;
} lv_speech_recog_ext_t;

typedef struct
{
    char * text;
} speech_recog_text_t;

typedef struct
{
    lv_watch_obj_ext_t old_ext;
    lv_ll_t page_text;                    /*speech_recog_text_t*/
    speech_recog_text_t * cur_page_text;
    lv_obj_t * label;
    lv_obj_t * img_next;
    lv_obj_t * img_prev;
    lv_coord_t interval;
} lv_speech_recog_detail_ext_t;

typedef struct
{
    lv_watch_obj_ext_t old_ext;
    lv_obj_t * img;
} lv_speech_recog_send_ext_t;

typedef struct
{
    lv_watch_obj_ext_t old_ext;
    lv_obj_t * img;
    lv_obj_t * bar;
    lv_obj_t * label_time;
    uint8_t audio_index;
    int16_t cur_max_value;
    lv_task_t * bar_task;
} lv_speech_recog_audio_ext_t;

/**********************
* GLOBAL PROTOTYPES
**********************/
/**
 * Create a speech recognition application
 */
void speech_recog_create_event_cb(lv_obj_t * btn, lv_event_t e);
void speech_recog_mt_call_ind(void);
#if 0
void speech_recog_alarm_ind(void);
#endif

/**********************
*      MACROS
**********************/

#endif /*USE_LV_WATCH_SPEECH_RECOG*/

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /*SPEECH_RECOG_H*/
